﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;

using System.Text;
using System.Windows.Forms;

namespace CommonTools
{
    public partial class ucLoading : UserControl
    {
        public ucLoading()
        {
            InitializeComponent();
            this.pictureBox1.Location = new Point((this.Width - pictureBox1.Width) / 2,(this.Height - pictureBox1.Height) / 2);
        }

        protected override CreateParams CreateParams
        {

            get
            {

                CreateParams cp = base.CreateParams;

                cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT

                return cp;

            }

        }


        protected override void OnPaintBackground(PaintEventArgs pevent)
        {
            //do not allow the background to be painted 
        }

        private void ucLoading_SizeChanged(object sender, EventArgs e)
        {
            this.pictureBox1.Location = new Point((this.Width - pictureBox1.Width) / 2,(this.Height - pictureBox1.Height) / 2);
        }

        private void ucLoading_Resize(object sender, EventArgs e)
        {
            this.pictureBox1.Location = new Point((this.Width - pictureBox1.Width) / 2,(this.Height - pictureBox1.Height) / 2);
        }
    }
}
